include ../Makefile.param

COMPILE_DATE = $(shell date '+%Y-%m-%d %H:%M:%S')
CC:=$(CROSS)gcc
CPP:=$(CROSS)g++

CFLAGS := -Wall -fvisibility=hidden $(INC_PATH) 



SRCS    :=  $(wildcard *.c)
OBJS    :=  $(SRCS:%.c=%.o)

CPPSRCS    :=  $(wildcard *.cpp)
CPPOBJS    :=  $(CPPSRCS:%.cpp=%.o)


TARGET  = libmdk_dvrr.so
.PHONY : clean all

all:
	$(CC)  $(CFLAGS) -fPIC -c    $(SRCS)
#	$(CPP)  $(CFLAGS) -fPIC -c   $(CPPSRCS)

	$(CC)   -L./so -L../mdk/out -s -shared -fPIC -o   $(TARGET) $(OBJS) $(CPPOBJS) -lpthread -lm -lrt
	cp ./$(TARGET) /mnt/hgfs/pub/
	cp ./$(TARGET) ../mdk/out/
#	rm $(OBJS)
	
dbg:
	$(CC) $(GCCDBG) $(CFLAGS) -fPIC -c $(SRCS)
	$(CPP) $(GCCDBG) $(CFLAGS) -fPIC -c $(CPPSRCS)

	$(CC)   -L./so -L../mdk/out -shared -fPIC -o   $(TARGET) $(OBJS) $(CPPOBJS) -lmpi -lpthread -lm -lrt
	cp ./$(TARGET) /mnt/hgfs/pub/
	rm $(OBJS)
	
clean:
	@rm -f $(TARGET)
	@rm -f $(OBJS)
